<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=request.getContextPath()%>/resource/js/jquery-1.8.3.min.js"></script>
<link href="<%=request.getContextPath()%>/resource/css/index3.css" rel="stylesheet">
<script type="text/javascript">
	//分页
	function goPage(pageNum) {
		$("[name='pageNum']").val(pageNum);
		$("form").submit();
	}
	//查看
	function ck(id) {
		location="ck?id="+id;
	}
	//跳转调寝
	function tq() {
		location="tq";
	}
</script>
</head>
<body>
	<center>
		${student.name}管理您好，以下为宿舍入住情况
		<form action="admList" method="post">
			<input type="hidden" name="pageNum">
			楼号或宿舍号：<input type="text" name="sname" value="${vo.sname}">
			学生姓名：<input type="text" name="name" value="${vo.name}">
			<input type="submit" value="查询">
			<input type="button" value="调寝" onclick="tq()">
		</form>
		<table>
			<tr>
				<td>编号</td>
				<td>宿舍图片</td>
				<td>楼号</td>
				<td>宿舍号</td>
				<td>入住学生</td>
				<td>操作</td>
			</tr>
			<c:forEach items="${info.list}" var="d">
				<tr>
					<td>${d.id }</td>
					<td>
						<c:if test="${d.picture!=null}">
							<img src="${d.picture}" width="50px">
						</c:if>
					</td>
					<td>${d.fname }</td>
					<td>${d.dromNo }</td>
					<td>${d.names }</td>
					<td>
						<input type="button" value="查看详情" onclick="ck(${d.id })">
					</td>
				</tr>
			</c:forEach>
			<tr>
				<td colspan="10">
					<input type="button" value="首页" onclick="goPage(1)">
					<input type="button" value="上一页" onclick="goPage(${info.prePage})">
					<input type="button" value="下一页" onclick="goPage(${info.nextPage})">
					<input type="button" value="尾页" onclick="goPage(${info.pages})">
				</td>
			</tr>
		</table>
	</center>
</body>
</html>